{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%load_ext autoreload\n",
    "%autoreload 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "sys.path.insert(0,'../scripts')\n",
    "from generate_training_data import TrainDataGenerator"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "**********\n",
      "51  templates loaded\n",
      "**********\n"
     ]
    }
   ],
   "source": [
    "tdg = TrainDataGenerator(mode=\"ner\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 10/10 [00:00<00:00, 1203.74it/s]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[('pie chart of yrlw_ot column of zzz grouped by dz_k column',\n",
       "  {'entities': [(13, 20, 'COLNAME'),\n",
       "    (31, 34, 'VARNAME'),\n",
       "    (46, 50, 'COLNAME')]}),\n",
       " ('plot fqi_hczeud and vakdbgvkxfgomzbgg of df in a bar plot',\n",
       "  {'entities': [(5, 15, 'COLNAME'),\n",
       "    (20, 37, 'COLNAME'),\n",
       "    (41, 43, 'VARNAME')]}),\n",
       " ('scatter plot of wzvapheuza and jsbefivugeekdv in tempdf',\n",
       "  {'entities': [(16, 26, 'COLNAME'),\n",
       "    (31, 45, 'COLNAME'),\n",
       "    (49, 55, 'VARNAME')]}),\n",
       " ('plot histogram of dhqwz_ydyfw in df',\n",
       "  {'entities': [(18, 29, 'COLNAME'), (33, 35, 'VARNAME')]}),\n",
       " ('find min,minimum of csgc,hlbrbnql group by wuwgxhrsgvrcqaezot from mydf',\n",
       "  {'entities': [(5, 8, 'FUNCTION'),\n",
       "    (9, 16, 'FUNCTION'),\n",
       "    (20, 24, 'COLNAME'),\n",
       "    (25, 33, 'COLNAME'),\n",
       "    (43, 61, 'COLNAME'),\n",
       "    (67, 71, 'VARNAME')]}),\n",
       " ('import plotly', {'entities': [(7, 13, 'LIBNAME')]}),\n",
       " ('load test.csv', {'entities': [(5, 13, 'FNAME')]}),\n",
       " ('print df head', {'entities': [(6, 8, 'VARNAME')]}),\n",
       " ('describe df', {'entities': [(9, 11, 'VARNAME')]}),\n",
       " ('pie chart of oqayvfaukwgykiomp column of tempdf grouped by txtnmhqhfqts column',\n",
       "  {'entities': [(13, 30, 'COLNAME'),\n",
       "    (41, 47, 'VARNAME'),\n",
       "    (59, 71, 'COLNAME')]})]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tdg.generate_training_rows(n_rows=10)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
